package com.sky.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sky.valid.AddGroup;
import lombok.Data;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class OrdersSubmitDTO implements Serializable {

    //地址簿id
    @Min(value = 1, groups = {AddGroup.class})
    private Long addressBookId;

    //付款方式
    @Min(value = 1, groups = {AddGroup.class})
    private int payMethod;

    //备注
    @NotBlank(groups = {AddGroup.class})
    private String remark;

    //预计送达时间
//    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(groups = {AddGroup.class})
    private LocalDateTime estimatedDeliveryTime;

    //配送状态  1立即送出  0选择具体时间
    @Min(value = 0, groups = {AddGroup.class})
    private Integer deliveryStatus;

    //餐具数量
    @NotNull(groups = {AddGroup.class})
    private Integer tablewareNumber;

    //餐具数量状态  1按餐量提供  0选择具体数量
    @Min(value = 0, groups = {AddGroup.class})
    private Integer tablewareStatus;

    //打包费
    @Min(value = 0, groups = {AddGroup.class})
    private Integer packAmount;

    //总金额
    @DecimalMin(value = "0", groups = {AddGroup.class})
    private BigDecimal amount;
}
